<?php
namespace app\controller;

use app\BaseController;

use app\model\User;  // 引入User模型

use app\Request;
use think\facade\Db;

use think\facade\View;
use app\model\UserMsg;

class UserManage extends BaseController
{
    public function searchAll() {

        $res = UserMsg::select();

        return json(['msg' => '获取所有用户信息成功','data'=>$res, 'code' => 200]);
    }
    public function searchDelAll() {

        $res = UserMsg::where(['isDelete'=>'1'])->select();

        return json(['msg' => '获取所有已经注销用户信息成功','data'=>$res, 'code' => 200]);
    }
    public function searchUseAll() {

        $res = UserMsg::whereNotIn('isDelete','1')->select();

        return json(['msg' => '获取所有正常用户信息成功','data'=>$res, 'code' => 200]);
    }
    public function search(Request $request) {

        $input = $request->all();

        $res = UserMsg::where('username',$input['username'])->select();

        return json(['msg' => '查询用户信息成功','data'=>$res, 'code' => 200]);

    }

}
